package demo1;

public class Account {
    //实例变量
    double amount = 0.0;
    String owner;
    //静态变量利率
    static double interestRate = 0.0066;
    //静态方法
    public static double interestBy(double amt){
        return interestRate* amt;
    }
    //实例方法
    //计算给定金额 amt 的利息
    public String messageWith(double amt){
        double interest = Account.interestBy(amt);
        StringBuilder sb = new StringBuilder();
        sb.append(owner).append("的利息是：").append(interest);
        return sb.toString();
    }
}
